home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GFXFX2.ZIP / SCR_HUGE.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  1KB  |  57 lines

  1.  
  2. program bigscroll; { SCR_HUGE.PAS }
  3. uses u_vga,u_kb;
  4. const
  5.   vidptr=ptr($b800,0);
  6.   xs=4; ys=3;
  7.   txt:string='Large and bright enough?   ';
  8. var
  9.   virscr:pointer;
  10.  
  11. procedure ssl(buf:pointer); assembler; { scrolls text screen left }
  12. asm
  13.   push ds
  14.   les di,buf
  15.   lds si,buf
  16.   add si,2
  17.   mov dx,48
  18.  @l0:
  19.   mov cx,79
  20.   rep movsw
  21.   add si,2
  22.   add di,2
  23.   dec dl
  24.   jnz @l0
  25.   pop ds
  26. end;
  27.  
  28. procedure scroll;
  29. var poke:word; s,x,x2,y,y2,ch,txtidx:byte;
  30. begin
  31.   txtidx:=1;
  32.   repeat
  33.     ch:=byte(txt[txtidx]);
  34.     txtidx:=1+txtidx mod length(txt);
  35.     for x:=7 downto 0 do
  36.       for x2:=1 to xs do begin
  37.         vretrace;
  38.         ssl(virscr);
  39.         for y:=0 to 15 do begin
  40.           if boolean((mem[seg(font^):ofs(font^)+ch*16+y] shr x) and 1) then
  41.             poke:=$0adb else poke:=$0020;
  42.           for y2:=0 to ys-1 do memw[seg(virscr^):ofs(virscr^)+(y*ys+y2)*160+158]:=poke;
  43.         end;
  44.         flip(virscr,vidptr,2*80*50);
  45.       end;
  46.   until keypressed;
  47. end;
  48.  
  49. begin
  50.   setvideo(259); { needs VGA }
  51.   getfont(font8x16);
  52.   getmem(virscr,2*80*50); cls(virscr,2*80*50);
  53.   scroll;
  54.   freemem(virscr,2*80*50);
  55.   setvideo(u_lm);
  56. end.
  57.